#include <stdio.h>

int main(int argc, char *argv[]) 
{
	int m,n,i,su;
	scanf("%d",&m);
	for(n=1;n<=m;)
	{
		for(i=2;i<n;i++)
		{
			if(n%i==0)break;
			if(i==n-1)su=n;
		}
		n++;
	}
	printf("The max prime number is %d.\n",su);
}